package com.controller
{
	import com.ApplicationFacade;
	import com.model.UserProxy;
	import com.model.vo.UserVO;
	
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	public class DeleteUserCommand extends SimpleCommand implements ICommand
	{
		
		override public function execute(notification:INotification):void
		{
			var user:UserVO = notification.getBody() as UserVO;
			var userProxy:UserProxy = facade.retrieveProxy( UserProxy.NAME ) as UserProxy;
			userProxy.deleteItem(user);
			
			sendNotification(ApplicationFacade.USER_DELETED);
		}
	}
}